.class public Les/zd0;
.super Lcom/hierynomus/smbj/transport/c;
.source "DirectTcpPacketReader.java"


# direct methods
.method public constructor <init>(Ljava/io/InputStream;Lcom/hierynomus/smbj/transport/b;)V
    .locals 0

    .line 1
    invoke-direct {p0, p1, p2}, Lcom/hierynomus/smbj/transport/c;-><init>(Ljava/io/InputStream;Lcom/hierynomus/smbj/transport/b;)V

    return-void
.end method

.method private a(I)Lcom/hierynomus/smbj/smb2/d;
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 1
    new-array v0, p1, [B

    const/4 v1, 0x0

    const/4 v2, 0x0

    :goto_0
    const/4 v3, -0x1

    if-ge v1, p1, :cond_0

    .line 2
    iget-object v2, p0, Lcom/hierynomus/smbj/transport/c;->a:Ljava/io/InputStream;

    sub-int v4, p1, v1

    invoke-virtual {v2, v0, v1, v4}, Ljava/io/InputStream;->read([BII)I

    move-result v2

    if-eq v2, v3, :cond_0

    add-int/2addr v1, v2

    goto :goto_0

    :cond_0
    if-eq v2, v3, :cond_1

    .line 3
    new-instance p1, Lcom/hierynomus/smbj/common/b;

    invoke-direct {p1, v0}, Lcom/hierynomus/smbj/common/b;-><init>([B)V

    .line 4
    invoke-static {p1}, Lcom/hierynomus/smbj/smb2/messages/n;->a(Lcom/hierynomus/smbj/common/b;)Lcom/hierynomus/smbj/smb2/d;

    move-result-object p1

    return-object p1

    .line 5
    :cond_1
    new-instance p1, Lcom/hierynomus/smbj/transport/TransportException;

    const-string v0, "EOF while reading packet"

    invoke-direct {p1, v0}, Lcom/hierynomus/smbj/transport/TransportException;-><init>(Ljava/lang/String;)V

    goto :goto_2

    :goto_1
    throw p1

    :goto_2
    goto :goto_1
.end method

.method private b()I
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    const/4 v0, 0x4

    new-array v0, v0, [B

    .line 1
    iget-object v1, p0, Lcom/hierynomus/smbj/transport/c;->a:Ljava/io/InputStream;

    invoke-virtual {v1, v0}, Ljava/io/InputStream;->read([B)I

    .line 2
    new-instance v1, Lcom/hierynomus/protocol/commons/buffer/Buffer$b;

    sget-object v2, Lcom/hierynomus/protocol/commons/buffer/a;->b:Lcom/hierynomus/protocol/commons/buffer/a;

    invoke-direct {v1, v0, v2}, Lcom/hierynomus/protocol/commons/buffer/Buffer$b;-><init>([BLcom/hierynomus/protocol/commons/buffer/a;)V

    .line 3
    invoke-virtual {v1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->e()B

    .line 4
    invoke-virtual {v1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->h()I

    move-result v0

    return v0
.end method


# virtual methods
.method protected a()Lcom/hierynomus/smbj/smb2/d;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/smbj/transport/TransportException;
        }
    .end annotation

    .line 6
    :try_start_0
    invoke-direct {p0}, Les/zd0;->b()I

    move-result v0

    .line 7
    invoke-direct {p0, v0}, Les/zd0;->a(I)Lcom/hierynomus/smbj/smb2/d;

    move-result-object v0
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException; {:try_start_0 .. :try_end_0} :catch_0

    return-object v0

    :catch_0
    move-exception v0

    goto :goto_0

    :catch_1
    move-exception v0

    .line 8
    :goto_0
    new-instance v1, Lcom/hierynomus/smbj/transport/TransportException;

    invoke-direct {v1, v0}, Lcom/hierynomus/smbj/transport/TransportException;-><init>(Ljava/lang/Throwable;)V

    throw v1
.end method
